package facade;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class Database {
    private Database() {//防止外部new出Database的实例，所以声明为private

    }
    public static Properties getProperties(String dbname){//根据数据库名获取Properties
        String filename=dbname+".txt";
        Properties properties=new Properties();
        try {
            properties.load(new FileInputStream(filename));

        } catch (IOException e) {
            System.out.println("Warning:"+filename+" is not found.");
        }
        return properties;
    }
}
